﻿using System;
using System.ComponentModel;
using ElectronicCommerce.Framework.TcpHelper.Server;

namespace ElectronicCommerce.Framework.TcpHelper.Client
{
    /// <summary>
    /// Inerface Message Client
    /// </summary>
    public interface IMessageClient
    {
        event EventHandler<AsyncCompletedEventArgs> ConnectionCompleted;

        event EventHandler<AsyncCompletedEventArgs> SendCompleted;

        event EventHandler<EventArgs> ConnectionLost;

        event EventHandler<MessageEventArgs> MessageRecieved;

        bool IsConnected { get; }

        void ConnectAsync();

        void ConnectAsync(object state);

        void Disconnect();

        void SendMessageAsync(MessageInfo message);

        void SendMessageAsync(MessageInfo message, object userState);
    }
}
